
exports.init = function(app, models) {

    var index    = require('./controller');
    var customer = require('./controller/customer');
    //var quote    = require('./controller/quote');
    var user     = require('./controller/user');
    var part     = require('./controller/part');

    // set models
    customer.model = models.Customer;
    //quote.model    = models.Quote;
    user.model     = models.User;
    part.model     = models.Part;

    // set controllers
    app.get('/', index.index);

    // Customer GRUB
    app.get(   '/customers', customer.read);
    app.post(  '/customers', customer.add);
    app.put(   '/customers', customer.update);
    app.delete('/customers', customer.destroy);


    // Quote GRUB
    //app.get(   '/quotes', quote.read);
    //app.post(  '/quotes', quote.add);
    //app.put(   '/quotes', quote.update);
    //app.delete('/quotes', quote.destroy);

    // User GRUB
    app.get(   '/users', user.read);
    app.post(  '/users', user.add);
    app.put(   '/users', user.update);
    app.delete('/users', user.destroy);

    // Part GRUB
    app.get(   '/parts', part.read);
    app.post(  '/parts', part.add);
    app.put(   '/parts', part.update);
    app.delete('/parts', part.destroy);
};
